﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAL;
using Entities;
using BUS;
using Utility;

public partial class Administrator_delete : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            xoa_doanhnghiep();
            xoa_khachhang();
            xoa_httt();
            xoa_sp();
        }

    }
    private void xoa_sp()
    {
        try
        {
            int id = int.Parse(Request.QueryString["idsanpham"].ToString());
            Tbl_sanpham_BUS.Delete(id);
            Response.Redirect("~/Administrator/sanpham.aspx");
        }
        catch { }
    }
    private void xoa_doanhnghiep()
    {
        try
        {
            int id = int.Parse(Request.QueryString["iddoanhnghiep"].ToString());
            Tbl_doanhnghiep_BUS.Delete(id);
            Response.Redirect("~/Administrator/doanhnghiep.aspx");
        }
        catch { }
    }
    private void xoa_khachhang()
    {
        try
        {
            int id = int.Parse(Request.QueryString["idkhachhang"].ToString());
            Tbl_khachhang_BUS.Delete(id);
            Response.Redirect("~/Administrator/khachhang_ds.aspx");
        }
        catch { }
    }
    private void xoa_httt()
    {
        try
        {
            int id = int.Parse(Request.QueryString["idht"].ToString());
            Tbl_HTTT_BUS.Delete(id);
            Response.Redirect("~/Administrator/httt_ds.aspx");
        }
        catch { }
    }
}
